package com.itheima.tlias.dao.impl;

import com.itheima.tlias.dao.LogDao;
import org.apache.commons.io.IOUtils;
import org.springframework.stereotype.Repository;

import java.io.InputStream;
import java.util.List;

@Repository
public class LogDaoImpl implements LogDao {
    @Override
    public List<String> logs() throws Exception {
        InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("log.txt");
        return (List<String>) IOUtils.readLines(inputStream, "UTF-8");
    }
}